/**
 * Copyright (c) 2016-2020 qar All rights reserved.
 * <p>
 * https://www.qar.io
 * <p>
 * 版权所有，侵权必究！
 */

package com.example.feign.fallback;

import com.example.dto.Oauth2RegisteredClientDTO;
import com.example.feign.AuthFeignClient;
import com.example.feign.RegisteredClientFeignClient;
import com.example.model.api.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.client.circuitbreaker.NoFallbackAvailableException;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 用户接口 FallbackFactory
 *
 * @author Mark sunlightcs@gmail.com
 */
@Slf4j
@Component
public class RegisteredClientFeignClientFallbackFactory implements FallbackFactory<RegisteredClientFeignClient> {
    @Override
    public RegisteredClientFeignClient create(Throwable throwable) {
        return new RegisteredClientFeignClient() {


            @Override
            public Result<Oauth2RegisteredClientDTO> saveRegisteredClient(Oauth2RegisteredClientDTO dto) {
                return null;
            }

            @Override
            public Result<Oauth2RegisteredClientDTO> get(String id) {
                return null;
            }
        };
    }
}
